        TITLE   'Test stdout'
        PAGE 59, 132
        .LALL

; ------------------------------------------------------------------------
;  program
; ------------------------------------------------------------------------

TEST    SEGMENT PUBLIC 'CODE'
        assume cs:TEST, ds:TEST, es:TEST, ss:STACK

Start:
        mov ax, cs
        mov ds, ax
        mov es, ax

        mov ah, 09h                                     ; display string
        mov dx, offset display_message
        int 21h

        mov ah, 40h                                     ; write file
        mov bx, 0001                                    ; stdout
        mov cx, enddisplay_message - display_message - 1
        mov dx, offset display_message
        int 21h

        mov ax, 4C00h                                  ; quit
        int 21h

display_message:
        db 'you will get this message twice. get the picture ?', 0dh, 0ah
        db 'try this with xstdout > filename', 0dh, 0ah, 0dh, 0ah, "$"

enddisplay_message:

TEST    ENDS

; ------------------------------------------------------------------------
;  stack
; ------------------------------------------------------------------------
STACK   SEGMENT PARA STACK 'STACK'
          db 100 dup('STACK')
StackTop  dw 0
STACK   ENDS

        end Start
